/**
 * Copyright (c) Software Institute of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.modeler.figures;

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.CompoundBorder;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.LineBorder;
import org.eclipse.draw2d.MarginBorder;
import org.eclipse.draw2d.ToolbarLayout;
import org.eclipse.swt.graphics.Color;

/**
 * @author zl
 *
 */
public class MetaEnumFigure extends CommonFigure {
//	public static final Color ENUM_COLOR = new Color(null,238,245,230);
	public static final Color ENUM_COLOR = new Color(null,255,255,255);
	private IFigure body;
	private IFigure header;
	private IFigure literalCompart;
	
	public MetaEnumFigure(IFigure header){
		this.header = header;
		ToolbarLayout layout = new ToolbarLayout();
		setLayoutManager(layout);
		setBorder(new CompoundBorder(new LineBorder(ColorConstants.buttonDarker,1), new MarginBorder(1)));
		setBackgroundColor(ENUM_COLOR);
		setOpaque(true);
		Label stereotype = new Label("<<enumaration>>");
		add(stereotype);
		add(header);
		body = new Figure();
		body.setLayoutManager(new ToolbarLayout());
		literalCompart = new CompartmentFigure();
		body.add(literalCompart);
		add(body);
	}
	public IFigure getContentPane() {
		return body;
	}

	public IFigure getHeader() {
		return header;
	}
	
	public IFigure getLiteralCompart() {
		return literalCompart;
	}
}
